﻿<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" CodeBehind="GeoWorkday.aspx.cs"
    Inherits="GeoWeb.Demo.WorkDataConfig.GeoWorkdaySetup" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>工作日配置</title>    
    <style type="text/css">
        .todayColor
        {
            color: red;
            font-weight: bold;
        }
    </style>
    <script type="text/javascript" src="GeoMessageBox.js"></script>
    <script type="text/javascript" src="GeoWorkingday.js"></script>
    <link type="text/css" rel="stylesheet" href="syupb.css" />
    <script language="javascript">
        function InitForm() {
            var yearSelect = document.getElementById("SY");
            var newOption = null;
            var i = 0;
            //初始化年下拉列表框，从1900到2050
            for (i = 1900; i < 2050; i++) {
                yearSelect.options.add(CreateOption(i.toString(), i.toString()));
            }
            var monthSelect = document.getElementById("SM");
            //初始化月下拉列表框
            for (i = 1; i < 13; i++) {
                monthSelect.options.add(CreateOption(i.toString(), i.toString()));
            }
            //初始化“今天”按钮
            var oToTodayButton = document.getElementById("ToTodayButton");
            var oDate = new Date();
            oToTodayButton.innerHTML = "今天:" + oDate.getFullYear() + "-" + (oDate.getMonth() + 1) + "-" + oDate.getDate();

            //创建日历头，也就是“周天”列
            var calendarHeader = document.getElementById("CalendarHeader");
            GeoWD_CreateCalendarHeader(calendarHeader);
            //创建日历体，建立日期单元格
            var calendarTable = document.getElementById("CalendarTable");
            GeoWD_FillWorkdayGrid(calendarTable);
            //初始化日历，m_InitXML中包含了当前月的工作日信息
            GeoWD_OnInit('<%=m_InitXML %>');
        }
        function CreateOption(text, value) {
            var newOption = document.createElement("option");
            newOption.text = text;
            newOption.value = value;
            return newOption;
        }
        function UpdateWorkTime() {
            window.open("GeoWorkdayTime.aspx", "_blank", 'menu=no,width=800,height=300,left=0,top=0,status=yes,resizable=yes,scrollbars=yes')
        }
    </script>
</head>
<body onload="InitForm()">
    <form id="form1" runat="server">
    <div>
        <div id="detail" style="position: absolute; left: 0px; top: 0px; z-index: 100">
        </div>
        <table id="MainTable" class="MainTable" cellpadding="0" cellspacing="0" style="border: solid 0px inactiveborder;
            border-right: solid 0px buttonshadow; border-bottom: solid 0px buttonshadow;">
            <tr>
                <td>
                    <table>
                        <tr>
                            <td>
                                <font style="font-size: 10pt">请选择日历:</font>
                                <asp:DropDownList ID="CalendarNames" Style="width: 160pt" onchange="GeoWD_OnCurCalendarChanged(this,event)"
                                    runat="server">
                                </asp:DropDownList>
                            </td>
                            <td>
                                <button accesskey="n" onclick="GeoWD_OnCreateNewCalendar()" value="新建日历..." style="font-family: 宋体">
                                    新建日历(<span style="text-decoration: underline">N</span>)...</button>
                            </td>
                            <td>
                                <button id="ToTodayButton" onclick="ToToday()" style="font-family: 宋体">
                                    今天</button>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <table id="MainCalendarTable" style="cursor: default; width: 100%; height: 100%"
                        border="0">
                        <tr>
                            <td width="405">
                                <div style="position: absolute; top: 5px; z-index: -1; left: 2px">
                                    <font id="YMBG" style="color: #f0f0f0; font-family: 'Arial Black'; font-size: 48pt">
                                        <br />
                                    </font>
                                </div>
                                <div style="background-color: Gray">
                                    <table id="CalendarTable" style="width: 600px; height: 400px" cellpadding="0" cellspacing="1"
                                        class="CalendarOutline" bordercolor="#969696">
                                        <tbody>
                                            <tr class="CalendarHeader">
                                                <td colspan="7" style="background-color: White">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="7" style="background-color: White">
                                                    <font color="#ffffff" size="2" style="font-size: 9pt">
                                                        <select id="SY" name="SY" onchange="GeoWD_OnYMChange(this,event,'SY')" style="font-size: 12px;
                                                            width: 80pt">
                                                        </select>
                                                        年
                                                        <select id="SM" name="SM" onchange="GeoWD_OnYMChange(this,event,'SM')" style="font-size: 12px;
                                                            width: 60pt">
                                                        </select>
                                                        月 </font><font color="#000000" face="宋体" id="GZ" style="font-size: 9pt" size="4">
                                                    </font>
                                                    <br />
                                                </td>
                                            </tr>
                                            <tr id="CalendarHeader" class="CalendarHeader" align="middle" bgcolor="#e0e0e0">
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <input type="radio" id="WorkdayRadio" onclick="GeoWD_OnWorkdayRadioClick(this,event)"
                        name="WorkDay" value="2" /><label for="WorkdayRadio" style="font-size: 12px; font-family: 宋体"
                            accesskey="w">工作日(<span style="text-decoration: underline">W</span>)</label>
                    <input type="radio" id="PlaydayRadio" onclick="GeoWD_OnWorkdayRadioClick(this,event)"
                        name="WorkDay" value="4" /><label for="PlaydayRadio" style="font-size: 12px; font-family: 宋体"
                            accesskey="p">非工作日(<span style="text-decoration: underline">P</span>)</label>
                </td>
            </tr>
            <tr>
                <td>
                    <table style="width: 100%">
                        <tr>
                            <td>
                                <span id="progressSpan">
                                    <img id="progressImg" style="display: none" align="left" src="images/spinner.gif" />
                                    <span id="progressPrompt">就绪</span></span>
                            </td>
                            <td style="width: 90pt">
                                <button id="update" accesskey="u" onclick="UpdateWorkTime()" style="width: 100%;
                                    font-family: 宋体">
                                    设置工作时间段(<span style="text-decoration: underline">U</span>)</button>
                            </td>
                            <td style="width: 65pt">
                                <input type="hidden" id="ResultCache" />
                                <button id="Sumbit" accesskey="s" onclick="GeoWD_OnSubmit();" style="width: 60pt;
                                    font-family: 宋体">
                                    保存(<span style="text-decoration: underline">S</span>)</button>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
